queue implementation in python